package com.example.demo.service;

import com.example.demo.mapper.ProductMapper;
import com.example.demo.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class ProductServiceImpl implements ProductService{
    @Autowired
    ProductMapper productMapper;
    @Override
    public List<ProductMapper> getAllProduct() {
        return productMapper.selectAllProduct();
    }

    @Override
    public Product getProductByContent(Product product) {
        return productMapper.selectProductByContent(product);
    }

    @Override
    public int changeProductByContent(Product product) {
        return productMapper.updateProductByContent(product);
    }
}
